#include "CustomSort.h"
#include <iostream>
using namespace std;


void sort(int* array, int size) {
  for(int i = 0; i < size; i++){
      for(int j = 0; j < size - 1; j++){
         if(array[j + 1] < array[j]){
             int swap = array[j + 1];
             array[j + 1] = array[j];
             array[j] = swap;
         }
      }
  }
}


bool isSorted(int* array, int size){
    for(int i = 0; i < size-1; i++){
        if(array[i+1] < array[i]){
            return false;
        }
    }
    return true;
}


void print(int* array, int size) {
    cout <<  "array: [";
    for(int i = 0; i < size - 1; i++){
       cout << array[i];
       cout << " ";
    }
    cout << array[size - 1];
    cout << "]" << endl;
}

int main(){
    int size = 11;
    int a[] = {1, 4, 8, 8, 2, 2, 8, -359, 1337, 322, 0};
    print(a, size);
    cout << isSorted(a, size) << endl;
    sort(a, size);
    print(a, size);
    cout << isSorted(a, size) << endl;

}
